-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap around below #51
base: master
Are you sure you want to change the base?
Conversation
Bump. |
I'm broadly sympathetic, but why just wrap for the one step below? Since we're using midpoints, shouldn't it be half a step below, half a step above? Or should we just wrap all? |
I think that actually equivalent to this it comes down to how where indexing in the first place and we have this empty bin at the bottom |
I think I need to draw some pictures |
Ok, after playing with this, and master For Master:
This PR
So it doesn't seem right that the lower boundary just gets stiffed like that. You are correct that when it comes to actual wrap-around, Full detailsWith this PR:
Current master:
|
This could probably be handled better (maybe an optional |
Maybe rather than wrap around I could workout how to include the lower boundary and the an error on out of bounds |
@oxinabox you wanted to add some modifications, some tests? Maybe we can finish this one? |
My thesis is due in 1 week. |
no problem, just wanted to see pending PRs, good luck :) |
I noticed that at
KernelDensity.jl/src/univariate.jl
Lines 96 to 100 in bf4191d
if a point should be allocated to the lower boundary it is just discarded.
Meaning after tabulate the bottom bin is always empty.
As I read the original Jones and Lotwick paper
https://www.jstor.org/stable/pdf/2347674.pdf
there solution in the equivalent case is to wrap-around.
Make sense as the FFT-convolution will wrap around anyway
Now in most usage, the lower (and upper) bins should be sufficiently far from the edge,
so as to avoid wrap-around effects from FFT-convolution.
(I am running it to it because I am explicitly wanting wrap around effects).
Possible rather than employing wrap-around in tabulate,
the alternative might be to just throw an error in an
else
statement added to thatif
Saying "Lower boundary too tight, please expand lower boundary"
It seem bad to just silently throw away data
This only handled the uni-variate case, if I am right it can be extended to the bivariate case